package com.htz.java250805_library.enums;

import lombok.Getter;

@Getter
public enum BookStatus {
    DELETE(0,"无效"),
    NORMAL(1,"可借阅"),
    FORBIDDEN(2,"不可借阅");

    private int code;
    private String desc;

    BookStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static BookStatus getDescByCode(int code){
        switch (code){
            case 0:return DELETE;
            case 1:return NORMAL;
            case 2:return FORBIDDEN;
            default:return null;
        }
    }
}
